<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-05-05 22:02:56
 * @LastEditors: 晋龍
 * @LastEditTime: 2022-01-10 20:55:42
-->

<template>
  <!--1. 容器 -->
  <div ref="bottom3_container" id="container6" style="height: 95%"></div>
</template>
<script>

import { Bar } from '@antv/g2plot';
import {get} from '../../../utils/request'
export default {
  data(){
    return {
      dataArr:[]
    }
  },
   mounted(){
     
   this.initData()

  },
  methods:{
   initData(){

      get('/dashboard/queryEngineerBindDeviceNumber').then(res => {
        console.log(3333,res);
        this.dataArr = res.data
        this.initChart()
      })
    },
    initChart(){
      const bar = new Bar('container6',{
       data:this.dataArr,
        xField: 'value',
  yField: 'type',
  seriesField: 'type',
  legend: {
    position: 'bottom',
  },
      
         
       

});

bar.render();
      
    }
  }

}
</script>

<style scoped>
</style>